package v5

import (
	"fmt"
	"mindonmap/models"
	"mindonmap/pkgs/e"
	"net/http"

	"github.com/gin-gonic/gin"
)

func CategoryList(c *gin.Context) {

	fmt.Printf("接口")

	data, err := models.GetTagsWithScenes()
	if err != nil {
		c.JSON(http.StatusOK, gin.H{
			"code": e.ERROR_DATA_TYPE_MISMATCH,
			"msg":  e.GetMsg(e.ERROR_DATA_TYPE_MISMATCH),
		})
		return
	}

	c.JSON(http.StatusOK, gin.H{
		"code": 200,
		"msg":  e.GetMsg(200),
		"data": data,
	})

}
